how to solve linear motion